<template>
  <div>
    <h2>我是用户界面</h2>
    <p>我是用户界面的相关信息，嘿嘿</p>
    <h2>{{userId}}</h2>
    <h2>{{$route.params.userId}}</h2>
    <button @click="btnClick">按钮</button>
  </div>
</template>

<script>
    export default {
      name: "user",
      created() {
        // console.log('User created');
      },
      destroyed() {
        // console.log('User destroyed')
      },
      data(){
        return{
          message:'aaaaa'
        }
      },
        computed:{
          userId(){
            return this.$route.params.userId
          },
          finalMessage(){
            return this.message
          }
        },
      methods:{
        btnClick(){
          //所有的组件都继承自vue类的原型
          console.log(this.$router);
          console.log(this.$route);
        },
      }
    }
</script>

<style scoped>

</style>
